package com.gsafety.wellsfort.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gsafety.wellsfort.domain.model.knowledge.ExamPaper;
import com.gsafety.wellsfort.domain.model.knowledge.Work;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel(value = "我的试卷列表")
public class MyExamListVO {
    /**
     *
     */
    private Integer id;

    @ApiModelProperty(value = "试卷标题")
    private String examTitle;

    @ApiModelProperty(value = "建议时长")
    private Integer duration;


    @ApiModelProperty(value = "创建人")
    private Integer creator;

    @ApiModelProperty(value = "创建人名字")
    private String creatorName;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "考试发布记录ID")
    private String examPublishId;

    @ApiModelProperty(value = "考试总分")
    private BigDecimal totalScore;

    @ApiModelProperty(value = "得分")
    private BigDecimal score;

    public static  class VOBuilder{
        ExamPaper q ;
        MyExamListVO qVo=new MyExamListVO();
        public VOBuilder(ExamPaper q){
            this.q=q;
        }
        public MyExamListVO build(){
            BeanUtils.copyProperties(q,qVo);
            return qVo;
        }
    }
}
